package com.yly.common.suppor;

import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
/**
 * 用于单独获得非业务组件
 *
 */
public class SpringContextHelper implements ApplicationContextAware {

	private static ApplicationContext context ;
    public void setApplicationContext(ApplicationContext context)
            throws BeansException {
        SpringContextHelper.context = context;
    }
    public static Object getBean(String beanName){
        return context.getBean(beanName);
    }

}
